import request from '@/plugin/axios'
import { sysPath } from '@api/sys.common'

//店铺管理
export function getShops(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/getShops',
		method: 'get',
		params
	})
}

export function getShopList(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/page',
		method: 'post',
		data
	})
}

export function getShopDetail(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/findShopById',
		method: 'get',
		params
	})
}

export function addShop(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/addShop',
		method: 'post',
		data
	})
}

export function editShop(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/updateShop',
		method: 'post',
		data
	})
}

export function createQRcode(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/share/miniqrcode',
		method: 'post',
		params
	})
}

export function createPayQRcode(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/share/paymentcode',
		method: 'post',
		params
	})
}

// 收银员管理
export function getShopCashiers(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/shopCashier/getShopCashiers',
		method: 'get',
		params
	})
}

export function findShopCashierById(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/shopCashier/findShopCashierById',
		method: 'get',
		params
	})
}

export function saveOrUpdateShopCashier(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/shopCashier/saveOrUpdateShopCashier',
		method: 'post',
		data: params
	})
}

export function enableShopCashier(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/shopCashier/enableShopCashier',
		method: 'get',
		params
	})
}

export function CheckUserName(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/shopCashier/checkUserName',
		method: 'get',
		params
	})
}

export function deleteShopCashier(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/shop/shopCashier/deleteShopCashier',
		method: 'get',
		params
	})
}